#!/bin/bash
if [ $# -lt 2 ]; then
    echo "Usage: $0 [englist-file] [wordlst-file]"
    exit 1
fi

englst=$1
wordlst=$2
cat /dev/null > ${wordlst}
while read line
do
    echo "python3 req-youdao.py $line"
    python3 req-youdao.py $line >> ${wordlst}
    echo -e "\n" >> ${wordlst}
done<${englst}

sed -i '/^$/d' ${wordlst}
#sed -i 's/^[ ]\+//g' ${wordlst}
#sed -i '/^[ ]*$/d' ${wordlst}
#sed -i '/\[/{N;s/\n/  /}' ${wordlst}
#sed -i '/\[/{N;s/\n/  /}' ${wordlst}
